
// 创建材料列表
import MaterialEntity from "./entity/MaterialEntity";
import MachineEntity from "./entity/MachineEntity";
import ProcessEntity from "./entity/ProcessEntity";
import TaskEntity from "./entity/TaskEntity";
import StrategyEntity from "./entity/StrategyEntity";
import ProductionSchedule from "./ProductionSchedule";

let materialList = [];
let materialEntity = new MaterialEntity();
materialList.push(materialEntity);

// 创建机器列表
let machineList = [];
let machineEntity = new MachineEntity();
machineList.push(machineEntity);

// 创建工序列表
let processList = [];
let processEntity = new ProcessEntity();
processList.push(processEntity);

// 创建任务列表
let taskList = [];
let taskEntity = new TaskEntity();
taskEntity.processList = processList;
taskList.push(taskEntity);

// 创建优化策略列表
let strategyList = [];
let strategyEntity = new StrategyEntity();
strategyList.push(strategyEntity);

// 创建生产调度对象
let productionSchedule = new ProductionSchedule(
    materialList,
    machineList,
    processList,
    taskList,
    strategyList
);

// 计算最佳排产方案
 let result = productionSchedule.computeOptimalSchedule();
console.log("最佳生产量为：" + result);
